<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .a1:link {
            color: red;
        }

        .a1:visited {
            color: yellow;
        }

        .a1:focus {
            color: blue;
        }

        .a1:hover {
            color: green;
        }

        .a1:active {
            color: rgb(0, 208, 255);
        }

        /* #d1>div:first-child {
            color: red
        } */
        /* #d1>div:last-child {
            color: red
        } */
        /* #d1>div:nth-child(1) {
            color: red
        } */
        #d1>div:nth-child(6) {
            color: red
        }
        #d1>div:nth-child(7) {
            color: red
        }
        /* #d1>div:nth-child(n) {
            color: red
        } */
        /* #d1>div:nth-child(2n) {
            color: red
        } */
        /* #d1>div:nth-child(2n + 1) {
            color: red
        } */
        /* #d1>div:nth-child(odd) {
            color: red
        } */
        /* #d1>div:nth-child(even) {
            color: red
        } */
        /* div:nth-child(even) {
            color: red
        }  */
        /* #d2> div:first-of-type{
            color: red
        } */
        /* #d2> div:last-of-type{
            color: red
        } */
        /* #d2> div:last-of-type{
            color: red
        } */
        /* #d2> div:nth-of-type(1){
            color: red
        } */
        #d2> div:nth-of-type(6){
            color: red
        }
        #d2> div:nth-of-type(7){
            color: red
        }
        /* #d2> div:nth-of-type(2n){
            color: red
        } */
        /* #d2>div:nth-of-type(odd) {
            color: red
        } */
        /* #d2>div:nth-of-type(even) {
            color: red
        } */
    </style>
</head>

<body>
    <a href="" class="a1">1</a>
    <a href="" class="a1">1</a>
    <a href="" class="a1">1</a>
    <a href="" class="a1">1</a>
    <a href="" class="a1">1</a>
    <div id="d1">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <span>7-span</span>
        <div>8</div>

    </div>
    <hr>

    <div id="d2">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <span>7-span</span>
        <div>8</div>

    </div>
</body>

</html>